﻿using System;
using System.Collections.Generic;
using RssReader.FeedProvider;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace RssReader.Feeds
{
    public class ItemDetailsViewHelper
    {
        public Tuple<string, Dictionary<string, object>, Type> Get_selected_item_and_show_item_details_view(ItemClickEventArgs e, string itemsKeyString, UIElement windowCurrentContent)
        {
            var selectedItem = ((Item)e.ClickedItem);
            var selectedCategory = selectedItem.Category;

            var items = new Dictionary<string, object> { { itemsKeyString, selectedCategory.Feed } };

            var title = selectedItem.Title;
            var currentFrame = windowCurrentContent as Frame;
            var currentFrameType = App.Current_source_page_type(currentFrame);
            var tuple = new Tuple<string, Dictionary<string, object>,Type>(title, items,currentFrameType);

            return tuple;
        }
    }
}
